//index.js
//获取应用实例
const app = getApp()

Page({
  data: {
   shopList:[],
  },
  //事件处理函数
  bindViewTap: function() {
    wx.navigateTo({
      url: '../logs/logs'
    })
  },
  onLoad: function () {
   wx.request({
     url: 'https://www.hyhthjk.com.cn/index/goods/xcx',
     data: {
       page: "24",
       limit: '49'
     },
     header: {},
     method: 'GET',
     dataType: 'json',
     responseType: 'text',
     success:(res)=> {
      // console.log(res);
       /*
             *下面更新数据 更新视图
              */
       this.setData({
         shopList: res.data
       })
       console.log(this);
     },
     fail: function(res) {},
     complete: function(res) {},
   })
  },
  getUserInfo: function(e) {
    console.log(e)
    app.globalData.userInfo = e.detail.userInfo
    this.setData({
      userInfo: e.detail.userInfo,
      hasUserInfo: true
    })
  }
})
